Introduction

Perfect secrecy provides security against a limited variant of the ciphertext-only attack (COA) where the adversary is presented with only a single ciphertext - no more, no less. It was first described by the father of information theory - Claude Shannon who realised that for a cipher to be invulnerable to a single-COA attack (i.e. a ciphertext-only attack with a single ciphertext), the ciphertext must not reveal anything about the underlying plaintext.

Definition: Perfect Secrecy

An encryption scheme is perfectly secret if for every subset and for every strategy employed by the adversary Eve, if the plaintext was chosen at uniformly at random and was encrypted with a uniformly random key , then the probability that Eve can guess the plaintext when knowing its ciphertext is at most .

Definition Breakdown

When stripped of its mathematical coating, the definition is pretty simple. A plaintext is chosen at random from a set of plaintexts , which is a subset of the message space. There are possible messages for this choice, so the chance that Eve can guess the chosen message without having seen its ciphertext is . The premise behind perfect secrecy is that this holds true even if Eve does have access to the ciphertext - Eve should not be able to obtain any information from the ciphertext that would improve her chances of guessing the chosen plaintext.

Determining whether a given encryption scheme is perfectly secret might prove tricky when using this definition. Fortunately, there are some properties which can come in handy - every perfectly secret cipher has them and if a given encryption scheme has one of these properties, then it is perfectly secret and by extension has all of these properties (what are known as "if and only if" conditions).

Perfect Secrecy Equivalent Definitions

Since these properties go both ways - every perfectly secret cipher has these and every cipher which has one of these has all of them and is perfectly secret, they are called equivalent definitions.

For any perfectly secret encryption scheme , it is true that:

  1. For every two distinct plaintexts and any strategy employed by the adversary , if Eve is given a ciphertext of one of the plaintexts or , then the probability that Eve can guess the message the ciphertext belongs to is less than or equal to , i.e.

  1. For every two fixed plaintexts , the distributions and obtained by sampling the key space are identical.

  2. For every distribution over and strategy , the probability that Eve can guess a message chosen according to from its corresponding ciphertext is less than or equal to the highest probability assigned by the distribution , i.e.

Proof: Perfect Secrecy Properties

Proof of the first property:

If a Shannon cipher is perfectly secret, then the first property follows directly from the definition of perfect secrecy.

To prove the "if" direction we use a proof by contradiction. We need to show that if there were some set of plaintexts and a strategy for Eve to guess a chosen plaintext from with a probability greater than (i.e., the cipher were not perfectly secret), then there would also exist a set of size 2 for which Eve can guess a plaintext chosen from with probability greater than .

Essentially, this set would be for some plaintexts and such that .

To do this, fix to be the message of all 0s and pick a message uniformly at random from . Under our assumption, for any , it is true that

This can also be rewritten as

On the other hand, the string does not depend on for any choice of the key , so if is selected uniformly at random from , then the probability that is .

This can also be rewritten as

Now, by linearity of expectation

By the averaging argument, there must exist some for which .

In other words, we just proved the existence of two messages for which and can now construct the set which contradicts our initial condition. Therefore, cannot exist and by extension cannot either, making the cipher perfectly secret.

Proof of Second Property TODO

Proof of Third Property TODO

Now, these properties are useful, but does there actually exist a perfectly secret encryption scheme? The answer to that is yes and perhaps the most famous example of such a cipher is the One-Time Pad.

Long Keys Requirement

Perfect secrecy does impose one huge restriction - for an encryption scheme to be perfectly secret, its key cannot have a length shorter than that of the message.

Theorem: Long Keys Requirement

For every perfectly secret encryption scheme , the message length function satisfies .

Proof: Long Keys Requirement

Given a Shannon cipher , if the key was shorter than the message, then there would be fewer possible keys than possible messages, i.e. . An adversary can gain an edge by choosing a key instead of a plaintext at random and simply decrypting the known ciphertext with it. The probability that the decrypted ciphertext results in the hidden message , i.e. , will be and since there are fewer keys than messages, this probability is greater than , thus making the cipher not perfectly secret.

In proving the theorem, we have actually proved the following, more general statement.

Shannon's Theorem

For a Shannon cipher to be perfectly secret, the number of possible keys must be greater than or equal to the number of possible messages, i.e. .

The aforementioned relationship between the key and message lengths is just a corollary of this. This is a profound fact which limits the practicality of perfect secrecy. For example, if one wanted to securely transmit a 1 GB file using a perfectly secret encryption scheme, then they would also require a 1 GB key!

In conclusion, perfect secrecy is an amazing (and even implementable!) idea, but it is not practical. Due to this fact, perfectly secret ciphers are rarely employed in practice. Instead, relaxed security notions which are still good enough are used. As with most things in life, one cannot have their cake and eat it, too.